package cn.jsj.machine.service;

import cn.jsj.machine.pojo.CMachine;
import cn.jsj.machine.pojo.CPart;
import org.hibernate.validator.constraints.Length;
import org.springframework.validation.annotation.Validated;

import javax.validation.Valid;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

@Validated
public interface PartService {


    public List<CMachine> getMachineListByOnePart(@NotNull@Min(value = 1) Integer partID);

    public void resetPartWaringValue(@NotNull@Min(value = 1) Integer account,@NotBlank@Length(min = 5,max = 15) String password,@NotNull@Min(value = 1) Integer partID,@NotNull@Min(value = 1) Integer partValue);

    public void resetRmbOfPart(@NotNull@Min(value = 1) Integer account,@NotBlank@Length(min = 5,max = 15) String password,@NotNull@Min(value = 1) Integer partID,@NotNull@Min(value = 0)@Max(value = 999999999) Double newRmb);

    public void addPartNumber(@NotNull@Min(value = 1) Integer account,@NotBlank@Length(min = 5,max = 15) String password, @NotNull@Min(value = 1) Integer partID,@NotNull@Min(value = 0) Integer addNumber);

    public void cutPartNumber(@NotNull@Min(value = 1) Integer account,@NotBlank@Length(min = 5,max = 15) String password, @NotNull@Min(value = 1) Integer partID,@NotNull@Min(value = 0) Integer cutNumber);

    public void resetPartName(@NotNull@Min(value = 1) Integer account,@NotBlank@Length(min = 5,max = 15) String password,@NotNull@Min(value = 1) Integer partID,@NotBlank@Length(min = 1,max = 20) String newName);

    public void deleteOnePartInformation(@NotNull@Min(value = 1) Integer account,@NotBlank@Length(min = 5,max = 15) String password,@NotNull@Min(value = 1) Integer partID);

    public void addOnePart(@NotNull@Min(value = 1) Integer account,@NotBlank@Length(max = 20) String password,@NotBlank@Length(max = 20) String partName, @NotNull@Min(value = 0)@Max(value = 9999999) Integer remainNumber,@NotNull@Min(value = 1)@Max(value = 9999999) Integer limitNumber,@NotNull@Min(value = 0) Double rmb);

    @Valid
    public List<CPart> getPartList(@NotNull@Min(value = 1) Integer account,@NotBlank@Length(max = 20) String password);
}
